#define DEBUG
#include <cstdio>
#define MODS 998244353
#define G 3
#define MAXSIZE 262144

using namespace std;

long long power(long long a, long long n) {
  long long s=1;
  if (n==0) {
    return 1;
  }
  for (; n>1; n/=2) {
    if (n%2) {
      s = s*a%MODS;
    }
    a = a*a%MODS;
  }
  return a*s%MODS;
}

void ntt(long long *a, int n, long long *omg) {
  int lim, temp;
  for (lim=0; (1<<lim)<n; lim++);

  for (int i=0; i<n; i++) {
    int t=0;
    for (int j=0; j<lim; j++) {
      t|=((i>>j)&1)<<(lim-j-1);
    }
    if (i<t) {
      temp=a[i], a[i]=a[t], a[t]=temp;
    }
  }

  for (int len=2; len<=n; len*=2) {
    int m=len/2;
    for (int i=0; i<n; i+=len) {
      for (int j=0; j<m; j++) {
	temp=omg[(n/len*j)%n]*a[i+j+m]%MODS;
	a[i+j+m]=(a[i+j]-temp+MODS)%MODS;
	a[i+j]=(a[i+j]+temp)%MODS;
      }
    }
  }
}

void mul(long long *a, long long *b, long long *c, int n) {
  static long long omg[MAXSIZE], inv[MAXSIZE];
  omg[0]=inv[0]=1;
  omg[1]=power(G, (MODS-1)/n), inv[1]=power(omg[1], MODS-2);
  for (int i=1; i<n; i++) {
    omg[i] = omg[i-1]*omg[1]%MODS;
    inv[i] = inv[i-1]*inv[1]%MODS;
  }
  ntt(a, n, omg);
  ntt(b, n, omg);
  for (int i=0; i<n; i++) {
    c[i]=a[i]*b[i]%MODS;
  }
  ntt(c, n, inv);
  for (int i=0; i<n; i++) {
    c[i] = c[i]*power(n, MODS-2)%MODS;
  }
}

int main() {
#ifdef DEBUG
  freopen("4613.in", "r", stdin);
  freopen("4613.out", "w", stdout);
#endif
  
  static long long g[MAXSIZE], h[MAXSIZE], s[MAXSIZE];
  int n;
  scanf("%d", &n);

  h[0]=g[0]=1;
  g[1]=-1, h[1]=n+1;
  for (long long i=2, flag=1, fact=2; i<=n; i++, flag*=-1, fact=fact*i%MODS) {
    g[i] = (flag*power(fact, MODS-2)+MODS)%MODS;
    h[i] = (power(i, n+1)-1)*power(i-1, MODS-2)%MODS*power(fact, MODS-2)%MODS;
  }

  mul(g, h, s, MAXSIZE);

  long long temp=1, ans=s[0];
  for (int i=1; i<=n; i++) {
    temp=temp*i%MODS*2%MODS;
    ans = (ans+temp*s[i]%MODS)%MODS;
  }
  printf("%lld", ans);

  fclose(stdout);
  fclose(stdin);
  return 0;
}
